package cc.rengu.igas.bsps.common.enums;

import cc.rengu.oltp.utility.util.StringUtil;

/**
 * 营销产品编码转换枚举
 * <p>
 * if (key.length() == 12) {
 * txnNum + bizType + (0) + mcmp.T_B_MCHNT_AUTH_CTRL.support_acct_type.index → key
 * } else {
 * (key.length() == 10)
 * txnNum + bizType + (*) → key
 * }
 */
public enum MompBizProdCodeEnum {
    P01MC0010000("P01MC0010000", "MC001000", "POS刷卡消费-POS本行借记卡"),
    P01MC0010001("P01MC0010001", "MC001001", "POS刷卡消费-POS本行贷记卡"),
    P01MC0010010("P01MC0010010", "MC001002", "POS刷卡消费-POS他行卡"),
    P01MC01100("P01MC01100", "MC011000", "分期消费"),
    P01MC02100("P01MC02100", "MC021000", "微信条码被扫"),
    P01MC02101("P01MC02101", "MC021010", "支付宝条码被扫"),
    P01MC02102("P01MC02102", "MC021020", "银联云闪付条码被扫"),
    P01PM00200("P01PM00200", "PM002000", "微信公众号支付"),
    P01PM00201("P01PM00201", "PM002010", "微信小程序支付"),
    P01PM00202("P01PM00202", "PM002020", "微信APP支付"),
    P01PM00300("P01PM00300", "PM003000", "微信扫码支付"),
    P01PM00301("P01PM00301", "PM003010", "支付宝扫码支付"),
    P01PM00302("P01PM00302", "PM003020", "银联云闪付扫码支付"),
    P01PM00303("P01PM00303", "PM003030", "手机银行扫码支付"),
    P01PM0010000("P01PM0010000", "PM001000", "新卡支付-本行借记卡快捷"),
    P01PM0110000("P01PM0110000", "PM011000", "银行卡首次签约并支付-本行借记卡快捷"),
    P01PM0040000("P01PM0040000", "PM004000", "本行卡快捷支付-本行借记卡快捷"),
    P01PM0010001("P01PM0010001", "PM001001", "新卡支付-本行贷记卡快捷"),
    P01PM0110001("P01PM0110001", "PM011001", "银行卡首次签约并支付-本行贷记卡快捷"),
    P01PM0040001("P01PM0040001", "PM004001", "本行卡快捷支付-本行贷记卡快捷"),
    P01PM0010010("P01PM0010010", "PM001002", "新卡支付-他行卡快捷"),
    P01PM0110010("P01PM0110010", "PM011002", "银行卡首次签约并支付-他行卡快捷"),
    P01PM0040110("P01PM0040110", "PM004012", "银联无跳转支付(后台接口)-他行卡快捷"),
    P01PM0040210("P01PM0040210", "PM004022", "银联无卡快捷支付-他行卡快捷"),
    P01PM00500("P01PM00500", "PM005000", "手机银行SDK支付"),
    P01PM00900("P01PM00900", "PM009000", "手机银行银行卡+积分支付"),
    P01PM00600("P01PM00600", "PM006000", "银联云闪付支付"),
    P01PM00700("P01PM00700", "PM007000", "本行个人网关支付"),
    P01PM00702("P01PM00702", "PM007020", "他行个人网关支付"),
    P01PM00701("P01PM00701", "PM007010", "本行企业网关支付"),
    P01PM00703("P01PM00703", "PM007030", "他行企业网关支付"),
    P01PM01000("P01PM01000", "PM010000", "银行卡分期支付"),
    P01PM01200("P01PM01200", "PM012000", "手机银行扫码分期支付"),

    ;


    private String key;
    private String mompProdCode;
    private String description;

    public static String getMompProdCodeByKey(String key) {
        if (StringUtil.isEmptyOrNull(key)) {
            return null;
        }
        for (MompBizProdCodeEnum mompBizProdCodeEnum : MompBizProdCodeEnum.values()) {
            if (mompBizProdCodeEnum.getKey().equals(key)) {
                return mompBizProdCodeEnum.getMompProdCode();
            }
        }
        return null;
    }

    MompBizProdCodeEnum(String key, String mompProdCode, String description) {
        this.key = key;
        this.mompProdCode = mompProdCode;
        this.description = description;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getMompProdCode() {
        return mompProdCode;
    }

    public void setMompProdCode(String mompProdCode) {
        this.mompProdCode = mompProdCode;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
